#ifndef __BHTTP_BRESPONSE_H__
#define __BHTTP_BRESPONSE_H__
#pragma once

#include <string>
#include <vector>

namespace bhttp
{

class bresponse
{
public:
	void successed(const bool succ);
	bool successed() const;

	void body(const std::vector<char>& data);
	void body(std::vector<char>&& data);
	std::vector<char>& body();
	std::string body_as_string() const;

	void headers(const std::vector<char>& rh);
	void headers(std::vector<char>&& rh);
	std::vector<char>& headers();
    std::string header(const std::string& key);

	void code(int code);
	int code() const;
	char* error();

private:
	bool successed_{ false };
	std::vector<char> body_;
	std::vector<char> headers_;
	int code_{ -1 };
	char error_buffer_[256]{ 0 };
};

}
#endif //__BHTTP_RESPONSE_H__
